home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / rocket / rocket.frm (.txt) < prev    next >
Visual Basic Form  |  1998-03-30  |  8KB  |  247 lines

  1. VERSION 4.00
  2. Begin VB.Form frmrocket 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00FF0000&
  5.    Caption         =   "Blast Off"
  6.    ClientHeight    =   4950
  7.    ClientLeft      =   2115
  8.    ClientTop       =   1605
  9.    ClientWidth     =   4020
  10.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   5355
  21.    Left            =   2055
  22.    LinkTopic       =   "Form1"
  23.    MaxButton       =   0   'False
  24.    ScaleHeight     =   4950
  25.    ScaleWidth      =   4020
  26.    Top             =   1260
  27.    Width           =   4140
  28.    Begin VB.CommandButton cmdQuit 
  29.       Caption         =   "&QUIT"
  30.       Height          =   495
  31.       Left            =   3240
  32.       TabIndex        =   5
  33.       Top             =   4320
  34.       Width           =   735
  35.    End
  36.    Begin VB.CommandButton cmdRight 
  37.       Caption         =   "RIGHT"
  38.       Height          =   495
  39.       Left            =   120
  40.       TabIndex        =   4
  41.       Top             =   1560
  42.       Width           =   1215
  43.    End
  44.    Begin VB.CommandButton cmdLeft 
  45.       Caption         =   "LEFT"
  46.       Height          =   495
  47.       Left            =   120
  48.       TabIndex        =   3
  49.       Top             =   840
  50.       Width           =   1215
  51.    End
  52.    Begin VB.CommandButton cmdDown 
  53.       Caption         =   "DOWN"
  54.       Height          =   495
  55.       Left            =   2640
  56.       TabIndex        =   2
  57.       Top             =   1560
  58.       Width           =   1215
  59.    End
  60.    Begin VB.CommandButton cmdUp 
  61.       Appearance      =   0  'Flat
  62.       BackColor       =   &H80000005&
  63.       Caption         =   "UP"
  64.       Height          =   495
  65.       Left            =   2640
  66.       TabIndex        =   1
  67.       Top             =   840
  68.       Width           =   1215
  69.    End
  70.    Begin VB.PictureBox picRocket 
  71.       Appearance      =   0  'Flat
  72.       AutoRedraw      =   -1  'True
  73.       AutoSize        =   -1  'True
  74.       BackColor       =   &H80000005&
  75.       DrawStyle       =   5  'Transparent
  76.       ForeColor       =   &H80000008&
  77.       Height          =   510
  78.       Left            =   1680
  79.       Picture         =   "ROCKET.frx":0000
  80.       ScaleHeight     =   480
  81.       ScaleWidth      =   480
  82.       TabIndex        =   0
  83.       Top             =   3600
  84.       Width           =   510
  85.    End
  86.    Begin VB.Image imgLogo 
  87.       Height          =   480
  88.       Left            =   120
  89.       Picture         =   "ROCKET.frx":030A
  90.       Top             =   4320
  91.       Width           =   480
  92.    End
  93.    Begin VB.Label lblAuthor 
  94.       Alignment       =   2  'Center
  95.       BackColor       =   &H000000FF&
  96.       Caption         =   "   WRITTEN BY    ED HAMMOND "
  97.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  98.          Name            =   "Arial"
  99.          Size            =   9.75
  100.          Charset         =   0
  101.          Weight          =   700
  102.          Underline       =   0   'False
  103.          Italic          =   0   'False
  104.          Strikethrough   =   0   'False
  105.       EndProperty
  106.       ForeColor       =   &H00FFFFFF&
  107.       Height          =   495
  108.       Left            =   960
  109.       TabIndex        =   7
  110.       Top             =   4320
  111.       Width           =   1695
  112.    End
  113.    Begin VB.Line linQuitLeft 
  114.       BorderWidth     =   5
  115.       X1              =   3120
  116.       X2              =   3120
  117.       Y1              =   4200
  118.       Y2              =   4920
  119.    End
  120.    Begin VB.Line linQuitTop 
  121.       BorderWidth     =   5
  122.       X1              =   3120
  123.       X2              =   3960
  124.       Y1              =   4200
  125.       Y2              =   4200
  126.    End
  127.    Begin VB.Label lblInstuctions 
  128.       BackColor       =   &H000000FF&
  129.       Caption         =   "  Press the buttons with the left mouse key      to move the rocketship."
  130.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  131.          Name            =   "Arial"
  132.          Size            =   8.25
  133.          Charset         =   0
  134.          Weight          =   700
  135.          Underline       =   0   'False
  136.          Italic          =   0   'False
  137.          Strikethrough   =   0   'False
  138.       EndProperty
  139.       ForeColor       =   &H00FFFFFF&
  140.       Height          =   495
  141.       Left            =   120
  142.       TabIndex        =   6
  143.       Top             =   120
  144.       Width           =   3735
  145.    End
  146. Attribute VB_Name = "frmrocket"
  147. Attribute VB_Creatable = False
  148. Attribute VB_Exposed = False
  149. Dim Myup As Integer
  150. Dim Mydown As Integer
  151. Dim Myleft As Integer
  152. Dim Myright As Integer
  153. Dim Mymove As String
  154. Private Sub cmdDown_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  155.     If Button = 1 Then
  156.         Mydown = True
  157.         Mymove = down
  158.         Mypicturemove
  159.     End If
  160. End Sub
  161. Private Sub cmdDown_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  162.     If Button = 1 Then
  163.         Mydown = False
  164.         Mypicturemove
  165.     End If
  166. End Sub
  167. Private Sub cmdUp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  168.     If Button = 1 Then
  169.         Myup = True
  170.         Mymove = up
  171.         Mypicturemove
  172.     End If
  173. End Sub
  174. Private Sub cmdUp_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  175.     If Button = 1 Then
  176.         Myup = False
  177.         Mypicturemove
  178.     End If
  179. End Sub
  180. Private Sub cmdLeft_Click()
  181.     picRocket.Left = picRocket.Left - 50
  182. End Sub
  183. Private Sub cmdQuit_Click()
  184.     CH1_MENU.Show
  185.     Unload Me
  186. End Sub
  187. Private Sub cmdRight_Click()
  188.     picRocket.Left = picRocket.Left + 50
  189. End Sub
  190. Private Sub Form_Load()
  191. 'This centers the form on the screen
  192.     frmrocket.Top = (Screen.Height - frmrocket.Height) / 2
  193.     frmrocket.Left = (Screen.Width - frmrocket.Width) / 2
  194. End Sub
  195. Public Sub Mypicturemove()
  196.     If Mymove = up Then
  197.             Do While Myup = True
  198.                 DoEvents
  199.                 picRocket.Top = picRocket.Top - 1
  200.             Loop
  201.     End If
  202.     If Mymove = down Then
  203.             Do While Mydown = True
  204.                 DoEvents
  205.                 picRocket.Top = picRocket.Top + 1
  206.             Loop
  207.     End If
  208.     'ElseIf Mymove = lleft Then
  209.             'Do While Myleft = True
  210.                 'DoEvents
  211.                 'picRocket.Left = picRocket.Left - 1
  212.             'Loop
  213.         
  214.     'ElseIf Mymove = rright Then
  215.             'Do While Myright = True
  216.                 'DoEvents
  217.                 'picRocket.Left = picRocket.Left + 1
  218.             'Loop
  219.    'End If
  220. '*************************************************
  221.     Select Case Mymove
  222.         Case up
  223.             Do While Myup = True
  224.                 DoEvents
  225.                 picRocket.Top = picRocket.Top - 1
  226.             Loop
  227.         Case down
  228.             Do While Mydown = True
  229.                 DoEvents
  230.                 picRocket.Top = picRocket.Top + 1
  231.             Loop
  232.         
  233.         'Case lleft
  234.             'Do While Myleft = True
  235.                 'DoEvents
  236.                 'picRocket.Left = picRocket.Left - 1
  237.             'Loop
  238.         
  239.         'Case rright
  240.             'Do While Myright = True
  241.                 'DoEvents
  242.                 'picRocket.Left = picRocket.Left + 1
  243.             'Loop
  244.    End Select
  245. End Sub
  246. '*************************************************
  247.